import request from './request'
import {config} from '../config'
import { getMessageListMock } from '@/mock'


export const getMessageList = (page: number) => {
  if(config.useMock){
    return getMessageListMock(page)
  }
  return request({
    url: `${config.baseUrl}/api/message/list?page=${page}`,
    method: 'GET'
  })
}

export const clearUnreadCount = () => {
  return request({
    url: `${config.baseUrl}/api/message/clear`,
    method: 'GET'
  })
}